package com.cj.cms.template;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.views.freemarker.FreemarkerManager;

import freemarker.template.Configuration;

public class TemplateManager {
    private Configuration config;
	
    public Configuration getConfig() {
		return config;
	}

	private TemplateManager() {
    	config = (Configuration)ServletActionContext.getServletContext().getAttribute(FreemarkerManager.CONFIG_SERVLET_CONTEXT_KEY);
	}

	private static class Holder {
		public static TemplateManager instance = new TemplateManager();
	}

	public static TemplateManager getInstance() {
		return Holder.instance;
	}
}
